package com.zzyl.mapper;

import com.github.pagehelper.Page;
import com.zzyl.dto.RolePageQueryDto;
import com.zzyl.dto.RoleWithUserId;
import com.zzyl.entity.Role;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface RoleMapper {
    int deleteByPrimaryKey(Long id);

    int insert(Role record);

    int insertSelective(Role record);

    Role selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(Role record);

    int updateByPrimaryKey(Role record);


    Page<Role> pageQuery(RolePageQueryDto dto);

    Role selectByName(String roleName);

    List<String> selectRoleNamesByUserId(Long id);

    List<RoleWithUserId> selectRoleListByUserIds(List<Long> userIds);



    @Select("select * from sys_role where data_state = #{dataState}")
    List<Role> selectRoleByStatus(String dataState);
}